package cn.clq.ymcc.feign;

import cn.clq.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author clqlongbao
 * @version 1.0
 * @description:
 * @date 2022/7/25 14:58
 */
@Component
public class SearchMediaFilesFeignClientFallBackFactory implements FallbackFactory<SearchMediaFilesFeignClient> {

    @Override
    public SearchMediaFilesFeignClient create(Throwable throwable) {
        return new SearchMediaFilesFeignClient() {
            @Override
            public JSONResult searchMediaFiles(Long chapterId) {
                throwable.printStackTrace();
                return JSONResult.error("媒体服务不可达");
            }
        };
    }
}
